<script setup lang="ts">
import {onMounted, ref} from "vue";
//获取当前路由id
import { useRoute } from "vue-router";
import Message  from "@/component/message.vue";
// 获取当前路由实例
const route = useRoute();
const recId = ref('');
// 在组件挂载时获取路由查询参数中的id值，并赋值给响应式变量recId
onMounted(() => {
  // 从路由查询参数中获取id值并转换为字符串类型赋给recId
  recId.value = route.query.id as string;
})
</script>

<template>
大家好！我是hello <br>
  我接收到的参数是：{{recId}}

<Message pag-value="hello"/>

</template>

<style scoped>

</style>